﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.DebugLogHandler
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine
{
  [NativeHeader("Runtime/Export/Debug/Debug.bindings.h")]
  internal sealed class DebugLogHandler : ILogHandler
  {
    [ThreadAndSerializationSafe]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void Internal_Log(
      LogType level,
      LogOption options,
      string msg,
      Object obj);

    [ThreadAndSerializationSafe]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void Internal_LogException(Exception ex, Object obj);

    public void LogFormat(LogType logType, Object context, string format, params object[] args)
    {
      DebugLogHandler.Internal_Log(logType, LogOption.None, string.Format(format, args), context);
    }

    public void LogFormat(
      LogType logType,
      LogOption logOptions,
      Object context,
      string format,
      params object[] args)
    {
      DebugLogHandler.Internal_Log(logType, logOptions, string.Format(format, args), context);
    }

    public void LogException(Exception exception, Object context)
    {
      if (exception == null)
        throw new ArgumentNullException(nameof (exception));
      DebugLogHandler.Internal_LogException(exception, context);
    }
  }
}
